package com.dong.auth.security.matcher;

import javax.servlet.http.HttpServletRequest;

/**
 * 登录请求匹配器
 *
 * @author zhaodongchao
 * @version V1.0
 * @date 2021/10/18 0:07
 */
public class LoginRequestMatcher implements RequestMatcher {
    private static final String login_url = "/login";

    @Override
    public boolean matches(HttpServletRequest request) {
        //获取请求uri
        String requestURI = request.getRequestURI();
        if (!login_url.equals(requestURI)) {
            return false;
        }
        String method = request.getMethod();
        return method.equals("POST") || method.equals("GET");
    }
}
